<?php $arr=$this->get('cons_rep');?>
	<form method="post" onsubmit="return ajax_form(this)" action="<?php _e($this->module)?>/Index/delete" id="frm">	
		<div class="x-list-title">
		<table width="100%" border="0" height="100%">
		<tr>
			<td align="left">
				<h2>Danh sách người đại diện</h2>
			</td>
			<td align="right">	
				<div class="x-list-options">
					<a class="x-button" href="#Admin/Representative/Add">Thêm mới đại diện</a>
				</div>
			</td>
		</tr>
		</table>	
		</div>
		<table width="100%" cellpadding="5" class="x-list" >
			<tr>
				<th align="center" width="25">TT</th>
				<th>
					Tên đại diện
				</th>
				<th width="140">
					Chức vụ
				</th>
				<th width="140">
					Đại diện cho
				</th>
				<th width="170">
					Số điện thoại
				</th>
				<th>
					Địa chỉ
				</th>
				<th width="140">Ngày tạo</th>
				<th width="25" colspan="2">
					Tác vụ
				</th>
			</tr>
			<?php
			if(count($arr)==0){
				echo "<tr><td colspan='9' class='x-page'>Chưa có người đại diện nào !</td></tr>";
			}else{
				
				foreach( $arr as $k=>$a ){?>
				<tr>
					<td align="center" width="20"><?php _e($k+1);?></td>
					<td title="<?php _e($a["type"]);?>">
						<?php _e($a["name"]);?>
					</td>
					<td align="center"><?php _e($a['functions']);?></td>
					<td><?php _e($a['mirror_for']);?></td>
					<td align="center"><?php _e($a['phone']);?></td>
					<td align="center"><?php _e($a['address']);?></td>
					<td align="center"><?php _e(show_date(DATE_FORMAT,$a['date_created']));?></td>
					<td width="25" align="center">
						<a href="#Admin/Representative/edit?ID=<?php _e($a['ID'])?>" class="x-edit"></a>
					</td>
					<td width="25" align="center">
						<a href="#Admin/Representative/delete?ID=<?php _e($a['ID'])?>" class="x-delete"></a>
					</td>
				</tr>
			<?php }
			?>
				<tr>
					<td colspan="9" class="page">
						<div class="x-page">
							<?php $this->e("pagebar");?>	
						</div>	
					</td>
				</tr>
			<?php
			}
			?>
			
		</table>
	</form>
